﻿Public Class CRight
    Public Enum Right As Integer
        rightView = 1
        rightEdit = 2
        rightCreate = 4
        rightDelete = 8
        rightAudit = 16
        rightAuthorize = 32
    End Enum

    Public Property RightValue As Integer


    Public ReadOnly Property RightView As Boolean
        Get
            Return (RightValue And Right.rightView) > 0
        End Get
    End Property

    Public ReadOnly Property RightEdit As Boolean
        Get
            Return (RightValue And Right.rightEdit) > 0
        End Get
    End Property

    Public ReadOnly Property RightCreate As Boolean
        Get
            Return (RightValue And Right.rightCreate) > 0
        End Get
    End Property

    Public ReadOnly Property RightDelete As Boolean
        Get
            Return (RightValue And Right.rightDelete) > 0
        End Get
    End Property

    Public ReadOnly Property RightAudit As Boolean
        Get
            Return (RightValue And Right.rightAudit) > 0
        End Get
    End Property

    Public ReadOnly Property RightAuthorize As Boolean
        Get
            Return (RightValue And Right.rightAuthorize) > 0
        End Get
    End Property
End Class
